{% extends "base.html" %}
{% load djblets_deco i18n pipeline staticfiles %}

{% block scripts-post %}
{{block.super}}
{%  javascript 'djblets-forms' %}
{%  javascript 'oauth-edit' %}
{% endblock %}

{% block extrahead %}
{{block.super}}
 <link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}">
{%  stylesheet 'account-page' %}
{%  stylesheet 'djblets-forms' %}
{% endblock %}

{% block title %}{% spaceless %}
{%  if app %}
{%   blocktrans with app_name=app.name %}
OAuth2 Applications -- Edit {{app_name}}
{%   endblocktrans %}
{%  else %}
{%   trans "OAuth2 Applications -- New" %}
{%  endif %}
{% endspaceless %}{% endblock title %}

{% block content %}
{%  box "edit-oauth2-app" %}
<div class="box-head">
 <h1 class="box-title">
{%   if app %}
{%    blocktrans with app_name=app.name %}
  Edit {{app_name}}
{%    endblocktrans %}
{%   else %}
{%    trans "New OAuth2 Application" %}
{%   endif %}
 </h1>
</div>
<div class="box-main box-foot">
{%   if form.non_field_errors %}
 {{form.non_field_errors}}
{%   endif %}
 <form action="." method="POST">
{%   for fieldset_title, fieldset in fieldsets %}
{%    include "djblets_forms/admin/form_fieldset.html" %}
{%   endfor %}
  <div class="form-actions">
   <input class="primary" type="submit" value="{% trans 'Save' %}">
   <a class="btn danger" href="{{oauth2_page_url}}">{% trans 'Cancel' %}</a>
  </div>
 </form>
</div>
{%  endbox %}
{% endblock content %}
